Fix #420: Add ConsecutiveBlockMinimization model#668
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #668 +/- ##
==========================================
+ Coverage 96.97% 97.00% +0.02%
==========================================
Files 277 281 +4
Lines 37161 37594 +433
==========================================
+ Hits 36038 36467 +429
- Misses 1123 1127 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add the Consecutive Block Minimization satisfaction problem (Garey & Johnson SR17) to the algebraic/ category. Given an m×n binary matrix and bound K, decide whether a column permutation exists yielding at most K maximal blocks of consecutive 1's across all rows. - Model with SatisfactionProblem trait, dims=[n;n] permutation space - CLI create with --matrix (JSON) and --bound-k flags - Unit tests: creation, evaluation, count_blocks, brute_force, serialization, invalid permutation, empty matrix - Paper entry with citations (Kou 1977, Booth 1975, Haddadi 2008) - Example DB fixture with 2×3 matrix instance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implementation SummaryChanges
Deviations from Plan
Open Questions
|
There was a problem hiding this comment.
Pull request overview
Adds the ConsecutiveBlockMinimization (CBM) satisfaction problem (G&J SR17) to the models::algebraic category, wiring it into the library surface area, CLI instance creation, example DB fixtures, and docs/paper references.
Changes:
- Introduces
ConsecutiveBlockMinimizationmodel implementation + unit tests, and registers it in the algebraic module exports. - Adds CLI support for
pred create ConsecutiveBlockMinimizationvia--matrix(JSON 2D bool) and--bound-k. - Updates example fixtures and generated docs/paper artifacts to include CBM.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/unit_tests/trait_consistency.rs | Adds CBM to the trait/dims consistency sweep. |
| src/unit_tests/models/algebraic/consecutive_block_minimization.rs | New unit tests covering basic properties, evaluation, and brute force behavior. |
| src/models/mod.rs | Re-exports CBM from models. |
| src/models/algebraic/mod.rs | Registers CBM module + exports + example-db specs hook. |
| src/models/algebraic/consecutive_block_minimization.rs | New CBM model, schema registration, Problem/SatisfactionProblem impl, and variant declaration. |
| src/example_db/fixtures/examples.json | Adds a canonical model example fixture for CBM. |
| problemreductions-cli/src/commands/create.rs | Adds CBM to pred create dispatch + example string + --bound-k plumbing. |
| problemreductions-cli/src/cli.rs | Documents CBM flags and adds bound_k arg. |
| docs/src/reductions/reduction_graph.json | Updates reduction graph to include CBM node (but currently corrupted/invalid JSON). |
| docs/src/reductions/problem_schemas.json | Adds CBM schema entry. |
| docs/paper/references.bib | Adds CBM-related bibliography entries. |
| docs/paper/reductions.typ | Adds CBM definition block and example narrative for the paper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Empty matrix: zero blocks, always satisfies any bound. | ||
| return true; |
| { | ||
| "nodes": [ | ||
| { | ||
| "name": "BMF", | ||
| "variant": {}, | ||
| "category": "algebraic", | ||
| "doc_path": "models/algebraic/struct.BMF.html", | ||
| "complexity": "2^(rows * rank + r | ||
| Exported to: docs/src/reductions/reduction_graph.json | ||
|
|
||
| JSON content: | ||
| { |
Review Pipeline Report
Remaining issues for final review
🤖 Generated by review-pipeline |
Summary
Add ConsecutiveBlockMinimization satisfaction problem (Garey & Johnson SR17) to the algebraic/ category. Given an m×n binary matrix and bound K, decide whether a column permutation exists yielding at most K maximal blocks of consecutive 1's.
Fixes #420